package com.grt192.ui;

import java.awt.Image;
import java.awt.Toolkit;

/**
 * A set of similar Images whose color can be changed, then displayed.
 * @author nikhil, vikram
 */

public class ImageSet {

  public static final int   BLACK = 0,
                            GRAY = 1,
                            WHITE = 2,
                            RED = 3,
                            ORANGE = 4,
                            YELLOW = 5,
                            GREEN = 6,
                            BLUE = 7,
                            PURPLE = 8;
    private int color;

    private Image   TriangleIconBlack,
                    TriangleIconGray,
                    TriangleIconWhite,
                    TriangleIconRed,
                    TriangleIconOrange,
                    TriangleIconYellow,
                    TriangleIconGreen,
                    TriangleIconBlue,
                    TriangleIconPurple,
                    CurrentImage;

public ImageSet(){
        color = BLACK;

        //loading each Image from the TriangleIcon set
        Toolkit kit = Toolkit.getDefaultToolkit();

        TriangleIconBlack = kit.getImage("TriangleIconBlack.png");
        TriangleIconGray = kit.getImage("TriangleIconGray.png");
        TriangleIconWhite = kit.getImage("TriangleIconWhite.png");
        TriangleIconRed = kit.getImage("TriangleIconRed.png");
        TriangleIconOrange = kit.getImage("TriangleIconOrange.png");
        TriangleIconYellow = kit.getImage("TriangleIconYellow.png");
        TriangleIconGreen = kit.getImage("TriangleIconGreen.png");
        TriangleIconBlue = kit.getImage("TriangleIconBlue.png");
        TriangleIconPurple = kit.getImage("TriangleIconPurple.png");

        CurrentImage = TriangleIconBlack;
    }

public void setImage(int color){
    this.color = color;
    switch(color){
            case BLACK:
                CurrentImage = TriangleIconBlack;
                break;
            case GRAY:
                CurrentImage = TriangleIconGray;
                break;
            case WHITE:
                CurrentImage = TriangleIconWhite;
                break;
            case RED:
                CurrentImage = TriangleIconRed;
                break;
            case ORANGE:
                 CurrentImage =  TriangleIconOrange;
                 break;
            case YELLOW:
                 CurrentImage =  TriangleIconYellow;
                 break;
            case GREEN:
                 CurrentImage =  TriangleIconGreen;
                 break;
            case BLUE:
                 CurrentImage =  TriangleIconBlue;
                 break;
            case PURPLE:
                 CurrentImage =  TriangleIconPurple;
                 break;
            default:
                CurrentImage = TriangleIconBlack;
                break;
        }
    }
public Image display(){
    return CurrentImage;
    }
}
